import request from '@/utils/request';
// 分组
export const groupInfo = (data: any) => {
    return request({
        url: '/scrm-api/console/tenant/group/list-for-market',
        method: 'POST',
        data,
        noNeedLoading: true
    });
};
export const getCodeList = (data: any) => {
    return request({
        method: 'POST',
        url: '/scrm-api/console/market/channel/list',
        data,
        noNeedLoading: true
    });
};
// 开始/结束
export const beginningOrEnd = (data: any) => {
    return request({
        method: 'POST',
        url: '/scrm-api/console/market/channel/advance',
        data,
        noNeedLoading: true
    });
};
// 客户明细
export const cusDetails = (data: any) => {
    return request({
        method: 'POST',
        url: '/scrm-api/console/market/channel/customer',
        data
    });
};
// 下载和批量下载
export const batchDownLoadAsync = (data: any) => {
    return request({
        method: 'POST',
        url: '/scrm-api/console/market/channel/async-download',
        data
    });
};
// 下载和批量下载
export const batchDownLoad = (data: any) => {
    return request({
        method: 'POST',
        url: '/scrm-api/console/market/channel/download',
        data
    });
};
// 批量结束
export const asyncBatchEnd = (data: any) => {
    return request({
        method: 'POST',
        url: '/scrm-api/console/market/channel/async-finish',
        data,
        noNeedLoading: true
    });
};
// 单个结束
export const batchEnd = (data: any) => {
    return request({
        method: 'POST',
        url: '/scrm-api/console/market/channel/finish',
        data,
        noNeedLoading: true
    });
};
// 批量删除
export const batchDelAsync = (data: any) => {
    return request({
        method: 'POST',
        url: '/scrm-api/console/market/channel/async-del',
        data,
        noNeedLoading: true
    });
};
// 批量删除
export const batchDel = (data: any) => {
    return request({
        method: 'POST',
        url: '/scrm-api/console/market/channel/del',
        data,
        noNeedLoading: true
    });
};
// 新建活码
export const newCode = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/create',
        method: 'POST',
        data
    });
};
// 编辑活码
export const editCode = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/edit',
        method: 'POST',
        data
    });
};
// 查看活码
export const lookCode = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/info',
        method: 'POST',
        data
    });
};
// 渠道活码统计
export function channelStat(data: any) {
    return request({
        method: 'POST',
        url: '/scrm-api/console/market/channel/stats',
        data
    });
}
// 渠道活码统计详情
export function channelDials(data: any) {
    return request({
        method: 'POST',
        url: '/scrm-api/console/market/channel/stats_user',
        data
    });
}
// 渠道活码统计导出
export function exportTable(data: any) {
    return request({
        method: 'POST',
        url: '/scrm-api/console/market/channel/stats_user_export',
        data
    });
}
// 群活码列表
export const groupCodeList = (data: any) => {
    return request({
        url: '/scrm-api/console/market/groupchat/list',
        method: 'POST',
        data,
        noNeedLoading: true
    });
};
// 群活码批量下载
export const groupBatchDow = (data: any) => {
    return request({
        url: '/scrm-api/console/market/groupchat/download',
        method: 'POST',
        data
    });
};
// 渠道活码批量导出
export const batchExp = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/async-export',
        method: 'POST',
        data
    });
};
// 群活码批量删除
export const groupBatchDel = (data: any) => {
    return request({
        url: '/scrm-api/console/market/groupchat/del',
        method: 'POST',
        data,
        noNeedLoading: true
    });
};
// 批量结束
export const groupBatchEnd = (data: any) => {
    return request({
        url: '/scrm-api/console/market/groupchat/finish',
        method: 'POST',
        data,
        noNeedLoading: true
    });
};
// 群活码的结束活开始
export const groupStartOrEnd = (data: any) => {
    return request({
        url: '/scrm-api/console/market/groupchat/advance',
        method: 'POST',
        data,
        noNeedLoading: true
    });
};
// 群活码客户明细
export const groupCusDetail = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/customer',
        method: 'POST',
        data
    });
};
// 群活码添加
export const addGroupCode = (data: any) => {
    return request({
        url: '/scrm-api/console/market/groupchat/create',
        method: 'POST',
        data
    });
};
// 查看活码
export const lookGroupCode = (data: any) => {
    return request({
        url: '/scrm-api/console/market/groupchat/info',
        method: 'POST',
        data
    });
};
// 编辑群活码
export const editGroupCode = (data: any) => {
    return request({
        url: '/scrm-api/console/market/groupchat/edit',
        method: 'POST',
        data
    });
};
// 客户明细
export const groupDetail = (data: any) => {
    return request({
        url: '/scrm-api/console/market/groupchat/customer',
        method: 'POST',
        data
    });
};
// 客户标签
export const cusTagData = (data: any) => {
    return request({
        url: '/scrm-api/console/customer/tag/list-tag'
    });
};
// 群活码统计技基础信息
export function groupStatBase(data: any) {
    return request({
        method: 'POST',
        url: '/scrm-api/console/market/groupchat/statsBase',
        data
    });
}
export function groupStat(data: any) {
    return request({
        method: 'POST',
        url: '/scrm-api/console/market/groupchat/stats',
        data
    });
}
export const detailsExp = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/customer-export',
        method: 'POST',
        data
    });
};

export const getChannelCodeCount = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/get-count',
        method: 'POST',
        data
    });
};
/* ------------------------------新渠道活码统计接口—————————————————————————————— */
// 基本信息
export const statsBaseInfo = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/stats-base-info',
        method: 'POST',
        data
    });
};
// 数据统计
export const statsBase = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/stats-base',
        method: 'POST',
        data
    });
};
// 客户趋势图
export const statsTrend = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/stats-trend',
        method: 'POST',
        data
    });
};
// 客户来源占比和客户流失占比
export const statsUserProportion = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/stats-user-proportion',
        method: 'POST',
        data
    });
};
// 客户浏览时间段
export const statsScan = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/stats-scan',
        method: 'POST',
        data
    });
};
// 客户趋势导出
export const statsTrendExport = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/stats-trend-export',
        method: 'POST',
        data
    });
};
// 客户来源占比导出
export const sourceProportionExport = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/source-proportion-export',
        method: 'POST',
        data
    });
};
// 客户流失占比导出
export const lossProportionExport = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/loss-proportion-export',
        method: 'POST',
        data
    });
};
// 客户浏览时间段导出
export const statsScanExport = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/stats-scan-export',
        method: 'POST',
        data
    });
};
/**
 * 转移分组
 * @param data
 * @returns
 */
export const groupTransfer = (data: any) => {
    return request({
        url: '/scrm-api/console/market/channel/transfer-group',
        method: 'POST',
        data
    });
};
